// Copyright (c) 2009 Luca Marrocco.
// Modified or written by Luca Marrocco for inclusion with codej.
// Licensed under the Apache License, Version 2.0 (the "License")
package codej.ast;

import codej.ast.*;

public class IdExpression extends Expression {

	private String identifier;

	public IdExpression(String identifier) {
		this.identifier = identifier;
	}

	public void accept(Visitor visitor) {
		visitor.visit(this);
	}

	@Override
	public boolean equals(Object obj) {
		if (!obj.getClass().isAssignableFrom(IdExpression.class))
			return false;
		IdExpression anotherIdExpression = (IdExpression) obj;
		if (!identifier.equals(anotherIdExpression.identifier))
			return false;
		return true;
	}

	public String getIdentifier() {
		return identifier;
	}

	@Override
	public String toString() {
		return identifier.toString();
	}

}
